package com.trdcore.zyzkt.controller;

import com.trdcore.zyzkt.resp.ResultData;
import com.trdcore.zyzkt.service.VodService;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "腾讯视频点播")
@RestController
@RequestMapping("/api/vod")
public class VodApiController {

    @Autowired
    private VodService vodService;

    @GetMapping("getPlayAuth/{courseId}/{videoId}")
    public ResultData getPlayAuth(
            @Parameter(name="课程id", required = true)
            @PathVariable("courseId") Long courseId,
            @Parameter(name = "视频id", required = true)
            @PathVariable("videoId") Long videoId) {
        return  ResultData.success(vodService.getPlayAuth(courseId, videoId));
    }
}